package cn.z2huo.knowledge.basic.bit.bitwiseoperation;

/**
 * <p>按位与 和 取模
 *
 * @author z2huo
 */
class ModuloAnd {

    public static void main(String[] args) {

        System.out.println(0 % 4);
        System.out.println(1 % 4);
        System.out.println(2 % 4);
        System.out.println(3 % 4);
        System.out.println(4 % 4);
        System.out.println(5 % 4);

        System.out.println();

        System.out.println(0 & (4-1));
        System.out.println(1 & (4-1));
        System.out.println(2 & (4-1));
        System.out.println(3 & (4-1));
        System.out.println(4 & (4-1));
        System.out.println(5 & (4-1));

    }

}
